﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace OverStore.Runtime.Storage
{
    /// <summary>
    /// Desribe behavior of <see cref="AdoNetStorage{TConnection}"/> on physically commiting 
    /// transaction while opened <see cref="System.Data.IDataReader"/> exist or on disposing 
    /// storage while opened readers exist.
    /// </summary>
    public enum ProcessOpenedReadersMode
    {
        /// <summary>
        /// The <see cref="PersistingRuntimeException"/> is thrown. 
        /// Using this value may cause exception on persistence session disposing, that is not recommended, except cases of debugging and diagnostics.
        /// </summary>
        ThrowException,
        /// <summary>
        /// Storage forcibly closes all opened readers.
        /// </summary>
        ForciblyCloseReaders,
        /// <summary>
        /// <para>
        /// Storage physically commits transaction when last reader is closed.
        /// </para>
        /// <para>This flag is currently not supported.</para>
        /// </summary>
        WaitForReadersClosing
    }
}
